Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to write script regular statement

I want to add a field "promotion" in QlikSense.

The Data source form connected to the SQL Server, and not this field, it is necessary to filter out the database from the required, as a new field "promotion"

The SQLQuery  is

SELECT Max(IndexValue),CASE_NO,Subject

FROM [Members_Report_DYN_Batch] Where GroupName='MarketIndex'

GROUP BY CASE_NO,IndexValue,Subject

So how do I write the script regular statements?


Thanks in advance for any help!

11 Replies
Chanty4u
MVP
MVP

Sample:

Load *

Max(IndexValue),

Case_No,

subject

....From

where GroupName='MarketIndex' ;

sushil353
Master II
Master II

Hi Yang,

Your statement is not clear.. elaborate with an example if possible.

are looking to load the sql statement in qlikview

Load *

sql SELECT Max(IndexValue),CASE_NO,Subject

FROM [Members_Report_DYN_Batch] Where GroupName='MarketIndex'

GROUP BY CASE_NO,IndexValue,Subject;

jonathandienst
Partner - Champion III
Partner - Champion III

I am not at all sure what you are asking, but there is a problem with your SQL: you would not normally group by the field you are using in the Max function:

SELECT Max(IndexValue),CASE_NO,Subject

FROM [Members_Report_DYN_Batch] Where GroupName='MarketIndex'

GROUP BY CASE_NO,IndexValue,Subject

I suggest that you post some clear examples of what you are hoping to achieve.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

QS error.png

Not applicable
Author

QS error2.png

shraddha_g
Partner - Master III
Partner - Master III

put ; after Load *

It should be

Load *;

sql select Max(IndexVale) .........

Anonymous
Not applicable
Author

Try this

load * ;

Sql select

Max(IndexValue),CASE_NO,Subject

FROM [Members_Report_DYN_Batch] Where GroupName='MarketIndex'

GROUP BY CASE_NO,IndexValue,Subject;

sushil353
Master II
Master II

Try this:

load *

SQL Select Max(IndexValue) as IndexValue,CASE_NO,Subject

From "yulon_10e".dbo."Members_Report_DYN_Batch"

where GroupName = 'MarketIndex'

Group by CASE_NO,Subject;

Not applicable
Author

QS error3.png