Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
New Contributor III

set analysis syntax

The variable below works; but I need to return the date and get errors with my set expression:

variable:

sum({$< [Week Ending]=, DGdate = {'$(=Max({$<LogonID ={"*"},[Week Ending]= >}DGdate))'} >} [Avg Collected Balance])

Need:

date({$< [Week Ending]=, DGdate = {'$(=Max({$<LogonID ={"*"},[Week Ending]= >}DGdate))'} >})

the error is "Error in expression: ')' expected

Labels (2)
1 Solution

Accepted Solutions

Re: set analysis syntax

Do you expect to see a single date? or do you need to use Min or Max to get one date from multiple possible dates? Try one of these

If the expected output can only have a single value

Date(Only({$<[Week Ending], DGdate = {'$(=Max({$<LogonID ={"*"}, [Week Ending]>} DGdate))'}>} DGdate)

or if you need Min or Max date from multiple date values

Date(Max({$<[Week Ending], DGdate = {'$(=Max({$<LogonID ={"*"}, [Week Ending]>} DGdate))'}>} DGdate)

Date(Min({$<[Week Ending], DGdate = {'$(=Max({$<LogonID ={"*"}, [Week Ending]>} DGdate))'}>} DGdate)

View solution in original post

6 Replies
Highlighted

Re: set analysis syntax

Did you forget to add the date field in the expression?

Date(Only({$<[Week Ending], DGdate = {'$(=Max({$<LogonID ={"*"}, [Week Ending]>} DGdate))'}>} DGdate)
Highlighted
Partner
Partner

Re: set analysis syntax

Try This.

=sum({$< [Week Ending]=, DGdate = {"=$(=Max({$<LogonID ={"*"},[Week Ending]= >}DGdate))"} >} [Avg Collected Balance])

 

BR

Mohammed Mustaq

 

Highlighted
New Contributor III

set analysis syntax

re-stating the question:
ePortfBal; the variable below works correctly:

sum({$< [Week Ending]=, DGdate = {'$(=Max({$<LogonID ={"*"},[Week Ending]= >}DGdate))'} >} [Avg Collected Balance])

I need to return in a text box the date that the variable selects; so I removed Sum() and used Date(). With the statement below I get syntax issues.

date({$< [Week Ending]=, DGdate = {'$(=Max({$<LogonID ={"*"},[Week Ending]= >}DGdate))'} >})

the error is "Error in expression: ')' expected

Highlighted

Re: set analysis syntax

Date for what?
Highlighted
New Contributor III

Re: set analysis syntax

DGdate

Re: set analysis syntax

Do you expect to see a single date? or do you need to use Min or Max to get one date from multiple possible dates? Try one of these

If the expected output can only have a single value

Date(Only({$<[Week Ending], DGdate = {'$(=Max({$<LogonID ={"*"}, [Week Ending]>} DGdate))'}>} DGdate)

or if you need Min or Max date from multiple date values

Date(Max({$<[Week Ending], DGdate = {'$(=Max({$<LogonID ={"*"}, [Week Ending]>} DGdate))'}>} DGdate)

Date(Min({$<[Week Ending], DGdate = {'$(=Max({$<LogonID ={"*"}, [Week Ending]>} DGdate))'}>} DGdate)

View solution in original post