Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Amigo,
I have data of different people based on weeks (refer below screenshot)-
and I want to distribute it in 5 category for all weeks-
and distribution should be based on below table
expected output-
that means 1st category should be multiplied by 0.5 and 2nd by 0.2 and so on...
Hi,
2 options
1 SCRIPT
2 CHART
TMP: LOAD * Inline [ Name,W1,W2,W3,W4,W5 A,0,0,50,30,0 B,0,5,60,20,20 C,0,10,100,10,10 D,0,50,50,50,50 E,0,20,10,60,11 F,0,10,60,20,5 ] ; LET vNamFil = noofrows('Name'); FOR i = 1 TO NoOfRows('TMP') LET vTbl = FieldValue('Name', $(i)); FOR x = 1 to 5; UNQUALIFY*; DATA: LOAD *, $(x) AS Category Resident TMP Where Name = '$(vTbl)' ; NEXT NEXT DROP TABLE TMP; Inner Join Factor: LOAD num(Category) as Category, Replace([multiplication factor],'.',',') As [multiplication factor] Inline [ Category,multiplication factor 1,0.5 2,0.2 3,0.1 4,0.2 5,0 ]; SUMARY: LOAD Name AS _Name, W1*[multiplication factor] AS _W1, W2*[multiplication factor] AS _W2, W3*[multiplication factor] AS _W3, W4*[multiplication factor] AS _W4, W5*[multiplication factor] AS _W5 Resident DATA Order By Name asc ;