Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

only(Year)-1 doesn't work

Hi!

I'm struggling  with a problem that i think has something to do with the format of Year.

I'm loading a crosstable like this;

Data:

CrossTable(Year, Amount, 5)

LOAD [Company],

     Distributor

     Code,

     Family,

     Category,

     [2008],

     [2009],

     [2010]

FROM

(ooxml, embedded labels, header is 1 lines, table is DATA);

I've tried to change the format in the excel file for year but it doesn't change. I'va also tried to change it in the document settings as well but no luck.

Hence, this expression does not work;

=Only(Year)-1

Please Help

( =Only(Year) works fine though..)

Labels (1)
10 Replies
IAMDV
Master II
Master II

Qlikview is interpreting the previous Field Names as string. And using the Only or Num function will not convert the Field type. However, if you use Num# - QV evaluates the expression numerically according to the string given as format-code.

So you if you use Num#(MyYear) -1  AS PreviousYear in the resident load, it should work. Do let me know if you need further help!

Cheers - DV