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: 
Anonymous
Not applicable

Populate the values - In Script

Hi Team,

I need to populate the score column(marked in red). I have used the count function(count (Score#)) in the script to populate the output of the value available in Score#(ie. 43). I need a solution in script to populate the Score column with all the values of quarter as same as Q1(ie 43). Please if anyone can help with the solution.

QtrScore #Score
Q1-154343
Q2-15043
Q3-15043
Q4-15043
Q1-16-43
Q2-16-43
Q3-16-43
Q4-16-43

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Use the below, this is assuming your data is properly sorted.

LOAD Qtr,

     [Score #],

     if(RowNo()=1,[Score #],Peek(Score)) as Score

FROM

[https://community.qlik.com/thread/243395]

(html, codepage is 1252, embedded labels, table is @1);

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

7 Replies
vinieme12
Champion III
Champion III

What if Q2-2015 was a greater number, what would you want then? please explain the exact basis of populating the nem column

QtrScore #Score
Q1-154343
Q2-155043
Q3-15043
Q4-15043
Q1-16-43
Q2-16-43
Q3-16-43
Q4-16-43
Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

Hi Vineeth,

I understand that it can be many scenario, but in this case it would be only 1 value the one which am populating as per the business logic. Its customer requirement. There wont be any value going forward.

hope its bit clear now. Please let me know if its not.

vinieme12
Champion III
Champion III

Use the below, this is assuming your data is properly sorted.

LOAD Qtr,

     [Score #],

     if(RowNo()=1,[Score #],Peek(Score)) as Score

FROM

[https://community.qlik.com/thread/243395]

(html, codepage is 1252, embedded labels, table is @1);

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

Thanks Vineeth.

MarcoWedel

Hi,

another solution might be:

QlikCommunity_Thread_243395_Pic1.JPG

table1:

LOAD Dual(Qtr,AddMonths(Date#(Right(Qtr,2),'YY'),(Mid(Qtr,2,1)-1)*3)) as Qtr,

    [Score #]

FROM [https://community.qlik.com/thread/243395] (html, codepage is 1252, embedded labels, table is @1);

Join

LOAD FirstSortedValue([Score #],Qtr) as Score Resident table1;

hope this helps

regards

Marco

Anonymous
Not applicable
Author

Thanks Marco.. Even this solution is working..

Your solution are  always unique!! Thank You!!!

MarcoWedel

thanks

glad you like it.

regards

Marco