Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Expression Total

Hi All

For some reason, When I use the expression total for the below IF Statement, it seems to display as true even though we are in Nov. - NUM(month(today())) is definitely greater than data in January - Please see attached for illustration.

Expression

=IF(Month_PurNum<=NUM(month(today())),SUM(JanValue_Pur),SUM(Jan_P))

13 Replies
Not applicable

Expression Total

Month.jpg

Not applicable

Re: Expression Total

Look at the formats of the dates you are compareing.

try

IF(Month(Month_PurNum)<=Month(NUM(month(today()))),SUM(JanValue_Pur),SUM(Jan_P))

You can also try:

Sum(IF(Month(Month_PurNum)<=Month(NUM(month(today()))),(JanValue_Pur),(Jan_P)))

Not applicable

Re: Expression Total

Hi

I just tried and it doesn't seem to work.

Note that the Month_PurNum is the month number.

More suggestion would be appreciated

Not applicable

Re: Expression Total

Alright, with that info try these:   Note: Check to make sure NUM(month(today())) is returning an integer (No Decimals)

try

IF(Month_PurNum<=NUM(month(today())),SUM(JanValue_Pur),SUM(Jan_P))

You can also try:

Sum(IF(Month_PurNum<=NUM(month(today())),(JanValue_Pur),(Jan_P)))

Not applicable

Re: Expression Total

Thanks for the below.

NUM(month(today())) is returning 11 (number for Nov.) and the suggestions didnt work. Hmmm,... any other please? I have been battling with this for a bit now -Smiley Sad

Not applicable

Expression Total

Hmm, just curious, in your second screen shot, what does each chart represent? (Top one has the 4500 value, bottom the 5672 value)

You could also check your Month_PurNum to see what the format is.

Can you upload a sample doument? (Can use scrambling if the data is confidential)

Not applicable

Re: Expression Total

Hi There

Thanks for your replies and help.

Data is sensitive and you will need the QVD, etc.

The First Chart represents Forecast Data per month.

The Second Chart Represents the Actual Data from SAP

The Third Chart is the summary.

And my IF statement is to say: If the month of purchase is less than this month, then display Actual data (i.e Second Chart) and if the month of purchase is greater than this month, then display forecast data.

Thanks

Maxwell

Not applicable

Expression Total

On your last chart what is the column directly to the left of Jan? The one that displays:

6

7

4

1

3

(Blank)

Not applicable

Re: Expression Total

Its the Month_PurNum

Community Browser