Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
swiftfahad
Contributor III
Contributor III

Expression on the basis of other expression

Hi all,

I have an expression in the pivot table and labeled it as max_date.

now I want to write

=Sum({<income_date=[max_date]}>}AMOUNT)

mean only amount of those are sum whose invoice_date is same as the date return in previous expression of the same table.

but it gives formatting error (little red mark) plz guide me for correct syntax.

thanks

14 Replies
Anil_Babu_Samineni

Not sure, I understand using..

If(income_date = Previous(max_date), 1,0) as Flag

Then, Try this?

=Sum({<income_date= {1}>}AMOUNT)

OR

=Sum({<income_date= {"=income_date = max_date"} >}AMOUNT)


Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
its_anandrjs

Can you share any sample data for this.

its_anandrjs

I suggest in place of the column name reference use the variables or direct set expression to be used

=Sum( { <income_date = {"$( =Max(DateField ))" } } >}AMOUNT)

swiftfahad
Contributor III
Contributor III
Author

sory read income as invoice in expression

=Sum({<invoice_date=[max_date]}>}AMOUNT)

Anil_Babu_Samineni

Boomm!! Read this..

Qlik Community Tip: How to Get Answers to Your Post

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
swiftfahad
Contributor III
Contributor III
Author

my max_date expression is

=date(max(aggr(max({$<inv_period_date={"<=$(v_userdate)"}>}invoice_date),customer_id),'dd/mmm/yyyy')

this expression is returning max date less then the userdate value (coming from calendar).

suppose user select 21/NOV/2016 from calendar now the maximum invoice_ period_ date for the customer is returned which suppose is 01/NOV/2016

Now i wana  return the value in next column  the amount where invoice date = '01/NOV/2016'

=Sum({<invoice_date=[max_date]}>}AMOUNT)

hope you understand the issue

any suggestion?

1) how to directly put the max_date expression in second expression

2) how to use its label

either of the solution can be fine

its_anandrjs

I believe in set analysis you not able to use it directly you have to use Paranthesis "{ }"

Check help from Qlik Help

http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/ChartFunctions/SetAnalysis/set-an...

its_anandrjs

Try this

=Sum( { <income_date =

{"$(=date(max(aggr(max({$<inv_period_date={"<=$(v_userdate)"}>}invoice_date),customer_id),'dd/mmm/yyyy')" } } >}AMOUNT)

Anil_Babu_Samineni

Try to create one variable and check in text box. Let me know what you are getting? Then declare that variable into analysis

=Sum( { <income_date = {$(VariableName)} >}AMOUNT)

OR

=Sum( { <income_date = {'$(VariableName)'} >}AMOUNT)

OR

=Sum( { <income_date = {'$(=VariableName)'} >}AMOUNT)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful