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

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasshana
Creator III
Creator III

Need help in Qlikview expression

Hi,

I've below table in my qlikview and the script.

Script:

---------------

LOAD Value,

     amount,

     date,

     month(date) as monthto,

     Num(month(date)) as month_num,

     year(date) as yearto

FROM

(biff, embedded labels, table is Sheet1$);

Table:

-------------- 

amountdateValuemonth_nummonthtoyearto
20013/12/2017A12Dec2017
45020/12/2017A12Dec2017
10001/01/2018A1Jan2018
20014/01/2018A1Jan2018
30003/02/2018A2Feb2018
10015/02/2018A2Feb2018
20002/03/2018A3Mar2018
15020/03/2018A3Mar2018

I'm looking for expression in straight table qlikview when ever user selects Jan as month in list box I would like to see output as below

ValuePrevious Month sum of salesCurrent Month sum of sales
A650300

when ever user selects Feb as month I would like to see output as below.

ValuePrevious Month sum of salesCurrent Month sum of sales
A300400

and more over I'm giving expression name manually but i would like to change that to month name as well. For example if user selects Feb as month in list box instead of Current Month Sum of sales i want month name as Feb and instead of Previous Month sum of sales I want Month name as Jan.

Message was edited by: Bharath Vikas Shanagonda Straight table

Labels (1)
13 Replies
sunny_talwar
MVP
MVP

Can you provide the file you are working with?

vikasshana
Creator III
Creator III
Author

I'm using personal edition, please find the attached. ! !

sunny_talwar
MVP
MVP

Misplaced my parenthesis... try this

=Sum({<MonthYear = {"$(=Date(MonthStart(Max(MonthYear), -1), 'MMM-YYYY'))"}, monthto>}amount)

=Sum({<MonthYear = {"$(=Date(MonthStart(Max(MonthYear), -2), 'MMM-YYYY'))"}, monthto>}amount)

vikasshana
Creator III
Creator III
Author

Yeah now it works perfect. Thanks for your help Sunny, much Appreciated..!!!!