Life expectancy depends on the specific type of cancer, the age and general health of the patient. It could be weeks to several months. There is much to consider.
Advanced liver cancer patients typically have a very short life expectancy - only a couple of months for those with hepatacellular carcinoma, but maybe 2 years for other advanced liver cancers.